/*
 * @Author: szx
 * @Date: 2022-05-20 13:47:10
 * @LastEditTime: 2022-05-20 13:56:30
 * @Description:
 * @FilePath: \leetcode\面试题\05\03\03.js
 */
// 记最大值
var reverseBits = function (num) {
    let cur = 0;
    let insert = 0;
    let res = 0;
    for (let i = 0; i < 32; i++) {
        if (num & (1 << i)) {
            // 1 逻辑与 判断是1
            cur++;
            insert++;
        } else {
            insert = cur + 1;
            cur = 0;
        }
        res = Math.max(res, insert);
    }
    return res;
};
